<extend name='./Base' />
<block name="css">
<link rel="stylesheet" href="__PUBLIC__/static/Synataxlighter/shCore.css">
  <link rel="stylesheet" href="__PUBLIC__/static/Synataxlighter/shThemeRDark.css">
</block>
<block name='admin-content-body'>
	<div class="admin-content-body">
	      <div class="am-cf am-padding am-padding-bottom-0">
	        <div class="am-fl"><strong class="am-text-primary am-text-lg">系统日志</strong> / <small>System Log</small></div>
	      </div>
	      <hr/>
	      <div class="am-g">
			<div class="am-u-sm-12 am-u-md-3">
				<div class="am-form-group">
					<div class="am-input-group am-input-group-sm">
						<span class="am-input-group-label">选择日期</span>
				<input type="text" class="am-form-field" name="logdate" placeholder="选择日期" onchange="readlog(this)" data-am-datepicker readonly value="<?php echo isset($_GET['logdate'])?$_GET['logdate']:date('Y-m-d');?>">
					</div>
				</div>
			</div>
		</div>
<pre class="brush: bash;">
{$logs}
</pre>
</div>
</block>
<block name='js'>
<script type="text/javascript" src="__PUBLIC__/static/Synataxlighter/shCore.js"></script>
<script type="text/javascript" src="__PUBLIC__/static/Synataxlighter/shBrushBash.js"></script>
<script type="text/javascript">
	SyntaxHighlighter.all();//语法高亮
	function readlog(obj){
		var selectDay=$(obj).val();
        var d = new Date;
        var today = new Date(d.getFullYear (), d.getMonth (), d.getDate ());
        var reg = /\d+/g;
        var temp = selectDay.match (reg);
        var sday = new Date (temp[0], parseInt (temp[1]) - 1, temp[2]);
        if (sday > today){
            layer.alert('请选择今天及其以前的日期',{icon:5});
			return 0;
        }
		location.href='__CONTROLLER__/logs/logdate/'+selectDay+'.html';
	}
</script>
</block>